package org.example.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.entity.User;

import java.util.List;

/**
 *
 */
public interface UserMapper {

    @Insert("insert into t_user(id,username,password) values(#{id}#{usernane},#{password})")
    void insert(User user);
    @Update("update t_user set username=?,password=? where id=#{id}")
    void update(User user);
    @Delete("delete from t_user where id=#{id}")
    void delete(String id);
    @Select("select * from t_user")
    List<User> getAll();
    @Select("select * from t_user where id = #{id}")
    User getById(String id);


    User getById1(String id);
}
